package adminService

import (
	"gitee.com/yangguoliang001/go-gin-vue3/dao/adminDao"
	"gitee.com/yangguoliang001/go-gin-vue3/dao/adminMenuDao"
	"gitee.com/yangguoliang001/go-gin-vue3/dao/menuActionDao"
	"gitee.com/yangguoliang001/go-gin-vue3/dao/menuDao"
	"github.com/go-redis/redis/v7"
	"gorm.io/gorm"
)

type AdminService struct {
	cache         *redis.Client
	adminDao      *adminDao.AdminDao
	menuDao       menuDao.MenuDao
	menuActionDao *menuActionDao.MenuActionDao
	adminMenuDao  adminMenuDao.AdminMenuDao
}

func New(db *gorm.DB, cache *redis.Client) *AdminService {
	return &AdminService{
		cache:         cache,
		adminDao:      adminDao.New(db),
		menuDao:       menuDao.New(db),
		menuActionDao: menuActionDao.New(db),
		adminMenuDao:  adminMenuDao.New(db),
	}
}
